<%@ page language = "java" import = "java.util.*" import = 
"javax.servlet.http.Cookie" %>

<%@ include file = "header.jspf" %>

<%
out.println("<html>");
out.println("<title>checking login...</title>"); 
out.println("<body><h1>checking login...</h1>");

String username = request.getParameter("username");
String password = request.getParameter("password");
Integer sessionID = 0;

sessionID = a.siteLogin(username,password);

if(sessionID > 0)
{
  Cookie sessionCookie = new Cookie(username,sessionID.toString());
  sessionCookie.setMaxAge(7200);
  response.addCookie(sessionCookie);
  out.println("<br>login successful...");
  out.println("<meta http-equiv=REFRESH content=0;url=index.jsp>");
}

else
{
  out.println("login failed: bad username and/or password");
}

out.println("</body></html>");

%>
